﻿@model CmsFileViewModel
@{
    string dialogId = string.Format("{0}_{1}", Model.DialogFor, DateTime.Now.Ticks);
    string dialogContainerId = string.Format("{0}_container", dialogId);
    ResFile = "cms_Common";
}

@functions
{
    IHtmlString GetCurrentPageId(int? currentPageId)
    {
        return currentPageId.HasValue ? new HtmlString("data-page-id=\""+ currentPageId.Value +"\"") : new HtmlString(string.Empty);
    }
}
<button class="b-button b-button_small showFileDialog @Model.DialogFor" @GetCurrentPageId(Model.CurrentPageId) id="@dialogId" type="button" value="@Model.TargetId">@_("Browse")</button>
<div class="b-files-tree" id="@dialogContainerId" style="display:none"></div>